package 多线程.多线程;

public class JionMethod {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() ->{
            for (int i = 0; i < 4; i++) {
                System.out.println("javaSe阶段的学习~~~");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"Se线程");
        Runnable r1 = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 4; i++) {
                    System.out.println("数据结构阶段的执行~~~");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        };
        Thread t2 = new Thread(r1,"数据结构线程");
        t1.start();
        t1.join(3000);
        t2.start();
        t2.join(2000);
        System.out.println("主线程执行~~~");
    }
}
